home *** CD-ROM | disk | FTP | other *** search
/ Workbench Design / WB Collection.iso / datatypes / jfif_dtc / install < prev    next >
Text File  |  1996-04-07  |  11KB  |  404 lines

  1. ;
  2. ; $VER: jfif_dtc_install 1.1 (10.12.94)
  3. ;
  4. ; Copyright (c) 1994 Christoph Feck, TowerSystems.
  5. ;
  6. ; Boy, do I hate brackets...
  7. ;
  8.  
  9. ;****************************************************************************
  10. ;
  11. ; English texts
  12. ;
  13.  
  14. (set #bad-kick (cat "You must have AmigaOS Release 3 or newer to be able to "
  15.     "use the JFIF DataType.")
  16. )
  17.  
  18. (set #old-jpeg (cat "    The Installer has found out, that your system has "
  19.     "an obsolete JPEG DataTypes Class installed.  The new JFIF DataType will "
  20.     "not work, if the old DataType remains installed.\n    You should select "
  21.     "\"Delete\" to delete it, or \"Move to Storage\" to move it into the "
  22.     "systems \"Storage/DataTypes\" drawer for later use.")
  23. )
  24.  
  25. (set #prefs-type (cat "    The JFIF DataType Preferences Editor allows you "
  26.     "to edit various options of the JFIF DataType, such as number of colors "
  27.     "or dithering mode, separately for every application.\n    There are two "
  28.     "versions of the editor available: a GadTools version (which uses the "
  29.     "ROM gadtools library), and a MUI (MagicUserInterface) version.  The "
  30.     "latter requires that you have MUI installed on your harddisk; MUI is "
  31.     "not included.\n\n" @askchoice-help)
  32. )
  33.  
  34. (set #jfif-descr (cat "    The JFIF DataTypes Descriptor is required to "
  35.     "identify JFIF files.  This file is usually placed into the "
  36.     "\"DEVS:DataTypes\" drawer, it will then automatically be added to the "
  37.     "list of available DataTypes on every reboot.\n    You may also place it "
  38.     "into the systems \"Storage/DataTypes\" drawer and only activate the "
  39.     "DataType, when you need it (simply double-click the \"JFIF\" icon).\n\n"
  40.     @copyfiles-help)
  41. )
  42.  
  43. (set #has-assign (cat "You already have the \"JPEGTMP:\" assignment, "
  44.     "probably left over from the old JPEG DataType.\n\nPlease do not remove "
  45.     "this assignment,\nthe JFIF DataType may also require it.")
  46. )
  47.  
  48. (set #temp-file (cat "    To obtain best quality images, the DataType needs "
  49.     "a large amount of memory.\n    If the required storage is not available "
  50.     "in main memory, the DataType will create a temporary file on your "
  51.     "harddisk.  The volume on which this file is created should have enough "
  52.     "free space (about 4 meg).\n    A temporary file is usually only "
  53.     "required, if you have selected the \"Compute Large Histogram\" option "
  54.     "in the JFIF DataTypes Preferences Editor.\n\n" @askdir-help)
  55. )
  56.  
  57. (set #make-assign (cat "    The logical assignment \"JPEGTMP:\" is used to "
  58.     "refer to the temporary directory.\n    In order to make this assignment "
  59.     "available on every reboot, an \"Assign\" command has to be added to "
  60.     "your \"user-startup\" file.\n\n" @startup-help)
  61. )
  62.  
  63. (set #why-reboot (cat "    You had an old JPEG DataType installed, which "
  64.     "may still be in memory.  The new JFIF DataType cannot work if you do "
  65.     "not reboot.  Select \"Reboot\" to reboot now, or select \"Cancel\", if "
  66.     "you want to reboot later.")
  67. )
  68.  
  69. (set #support-me (cat "This is Giftware.\n\nIf you use this DataType "
  70.     "regulary, please consider the amount of work I put into it.  Thank "
  71.     "you.\n\n")
  72. )
  73.  
  74. ;****************************************************************************
  75. ;
  76. ; Setup
  77. ;
  78.  
  79. (set @default-dest "")
  80.  
  81. (set libs-dest "LIBS:")
  82. (set class-dest "SYS:Classes")
  83. (set dt-dest "DEVS:DataTypes")
  84. (set storage "SYS:Storage")
  85. (set dt-storage "SYS:Storage/DataTypes")
  86. (set prefs-dest "SYS:Prefs")
  87. (set locale-dest "LOCALE:Catalogs")
  88.  
  89. (makedir storage)
  90. (makedir dt-storage)
  91. (makedir dt-dest)
  92.  
  93. (if (not (exists class-dest))
  94.     (set class-dest "LIBS:")
  95. )
  96.  
  97. (complete 0)
  98.  
  99. (if (< (/ (getversion) 65536) 39)
  100.     (abort #bad-kick)
  101. )
  102.  
  103. ;****************************************************************************
  104. ;
  105. ; Welcome
  106. ;
  107.  
  108. (welcome)
  109.  
  110. (message "\nTower JFIF DataTypes and JPEG Codec Class\n\nCopyright © 1994 "
  111.     "Christoph Feck, TowerSystems\nAll Rights Reserved.\n_\n\nJFIF DataType "
  112.     "Preferences (MUI Application)\n\nCopyright © 1994 Matthias Scheler\n"
  113.     "All Rights Reserved.\n\n\nPlease refer to the documentation for details."
  114. )
  115.  
  116. ;****************************************************************************
  117. ;
  118. ; Is the old JPEG datatype installed?
  119. ;
  120.  
  121. (set reboot 0)
  122.  
  123. (if (exists (tackon dt-dest "JPEG"))
  124.     (
  125.         (set reboot 1)
  126.         (if (askbool (help #old-jpeg) (prompt "You have an obsolete JPEG DataType installed.\nDo you want to delete it?") (choices "Delete" "Move to Storage"))
  127.             (
  128.                 (if (exists (tackon class-dest "DataTypes/jpeg.datatype"))
  129.                     (delete (tackon class-dest "DataTypes/jpeg.datatype"))
  130.                 )
  131.                 (if (exists (tackon dt-dest "JPEG"))
  132.                     (delete (tackon dt-dest "JPEG"))
  133.                 )
  134.                 (if (exists (tackon dt-dest "JPEG.info"))
  135.                     (delete (tackon dt-dest "JPEG.info"))
  136.                 )
  137.             )
  138.             ;else
  139.             (
  140.                 (if (exists (tackon dt-dest "JPEG"))
  141.                     (rename (tackon dt-dest "JPEG") (tackon dt-storage "JPEG"))
  142.                 )
  143.                 (if (exists (tackon dt-dest "JPEG.info"))
  144.                     (rename (tackon dt-dest "JPEG.info") (tackon dt-storage "JPEG.info"))
  145.                 )
  146.             )
  147.         )
  148.     )
  149. )
  150.  
  151. (complete 5)
  152.  
  153. ;****************************************************************************
  154. ;
  155. ; Install prefs editor
  156. ;
  157.  
  158. (if (or (exists "MUI:mui.key" (noreq)) (exists "S:mui.key" (noreq)))
  159.     (set prefseditor 1)
  160.     (set prefseditor 0)
  161. )
  162.  
  163. (if (set prefseditor (askchoice (help #prefs-type) (prompt "Which version of the JFIF DataType Preferences Editor would you like to use?") (choices "GadTools version" "MUI version") (default prefseditor)))
  164.     (copyfiles
  165.         (help @copyfiles-help)
  166.         (prompt "Copying JFIF DataType Preferences Editor...")
  167.         (source "Prefs/JFIFDataType")
  168.         (dest prefs-dest)
  169.         (infos)
  170.         (confirm)
  171.     )
  172.     ;else
  173.     (copyfiles
  174.         (help @copyfiles-help)
  175.         (prompt "Copying JFIF DataType Preferences Editor...")
  176.         (source "Prefs/JFIF DataType")
  177.         (dest prefs-dest)
  178.         (infos)
  179.         (confirm)
  180.     )
  181. )
  182.  
  183. (complete 10)
  184.  
  185. ;****************************************************************************
  186. ;
  187. ; Install catalogs
  188. ;
  189.  
  190. (if (exists (tackon locale-dest "deutsch"))
  191.     (if (IN (askoptions (help @askoptions-help) (prompt "Please indicate which languages to install.") (choices "English" "Deutsch")) 1)
  192.         (
  193.             (makedir (tackon locale-dest "deutsch/Classes"))
  194.             (copyfiles
  195.                 (help @copyfiles-help)
  196.                 (prompt "Copying JPEG codec catalog...")
  197.                 (source "Locale/Catalogs/deutsch/Classes/Codecs/jpeg.catalog")
  198.                 (dest (tackon locale-dest "deutsch/Classes/Codecs"))
  199.                 (optional nofail)
  200.             )
  201.             (if (= prefseditor 1)
  202.                 (copyfiles
  203.                     (help @copyfiles-help)
  204.                     (prompt "Copying JFIFDataType catalog...")
  205.                     (source "Locale/Catalogs/deutsch/JFIFDataType.catalog")
  206.                     (dest (tackon locale-dest "deutsch"))
  207.                     (optional nofail)
  208.                 )
  209.             )
  210.         )
  211.     )
  212. )
  213.  
  214. (complete 15)
  215.  
  216. ;****************************************************************************
  217. ;
  218. ; JPEGTMP: assignment
  219. ;
  220.  
  221. (set has-temp 0)
  222.  
  223. (if (exists "JPEGTMP:" (noreq))
  224.     (
  225.         (set has-temp 1)
  226.         (if (= "RAM" (getdevice "JPEGTMP:"))
  227.             (set has-temp 0)
  228.         )
  229.     )
  230. )
  231.  
  232. (if (= has-temp 1)
  233.     (message #has-assign)
  234.     ;else
  235.     (
  236.         (set jpeg-tmp (askdir (help #temp-file) (prompt "Select a directory for temporary files, not in RAM:") (default "SYS:")))
  237.         (startup "JFIF DataType"
  238.             (help #make-assign)
  239.             (prompt "An assignment has to be added to your user-startup.")
  240.             (command "Assign JPEGTMP: \"" jpeg-tmp "\"")
  241.         )
  242.         (makeassign "JPEGTMP" jpeg-tmp)
  243.     )
  244. )
  245.  
  246. (complete 20)
  247.  
  248. ;****************************************************************************
  249. ;
  250. ; Install DataTypes descriptor
  251. ;
  252.  
  253. (if (exists (tackon dt-dest "ILBM.info"))
  254.     (
  255.         (copyfiles
  256.             (help @copyfiles-help)
  257.             (prompt "Cloning icon...")
  258.             (source (tackon dt-dest "ILBM.info"))
  259.             (newname "JFIF.info")
  260.             (dest "Devs/DataTypes")
  261.             (optional nofail)
  262.         )
  263.         (tooltype
  264.             (help @tooltype-help)
  265.             (prompt "Unsnapshooting icon...")
  266.             (dest "Devs/DataTypes/JFIF")
  267.             (noposition)
  268.         )
  269.     )
  270. )
  271.  
  272. (copyfiles
  273.     (help #jfif-descr)
  274.     (prompt "Copying JFIF DataTypes Descriptor...")
  275.     (source "Devs/DataTypes/JFIF")
  276.     (dest dt-dest)
  277.     (infos)
  278.     (confirm)
  279. )
  280.  
  281. (complete 25)
  282.  
  283. ;****************************************************************************
  284. ;
  285. ; Copy Documentation
  286. ;
  287.  
  288. (set doc-dir (askdir (help @askdir-help) (prompt "Select a directory for the documentation.") (default "HELP:english/")))
  289. (copyfiles
  290.     (help @copyfiles-help)
  291.     (prompt "Copying JFIF.guide...")
  292.     (source "JFIF.guide")
  293.     (dest doc-dir)
  294.     (infos)
  295.     (optional nofail)
  296.     (confirm)
  297. )
  298.  
  299. (complete 30)
  300.  
  301. ;****************************************************************************
  302. ;
  303. ; Copy Default settings
  304. ;
  305.  
  306. (if (or (not (exists "ENVARC:Classes/DataTypes/jfif.prefs")) (not (exists "ENV:Classes/DataTypes/jfif.prefs")))
  307.     (
  308.         (makedir "ENVARC:Classes")
  309.         (copyfiles
  310.             (help @copyfiles-help)
  311.             (prompt "Copying default settings...")
  312.             (source "Prefs/Env-Archive/Classes/DataTypes/jfif.prefs")
  313.             (dest "ENVARC:Classes/DataTypes")
  314.         )
  315.         (makedir "ENV:Classes")
  316.         (copyfiles
  317.             (help @copyfiles-help)
  318.             (prompt "Copying default settings...")
  319.             (source "Prefs/Env-Archive/Classes/DataTypes/jfif.prefs")
  320.             (dest "ENV:Classes/DataTypes")
  321.         )
  322.     )
  323. )
  324.  
  325. (complete 35)
  326.  
  327. ;****************************************************************************
  328. ;
  329. ; Install libraries and classes
  330. ;
  331.  
  332. (copylib
  333.     (help @copylib-help)
  334.     (prompt "Copying tower.library...")
  335.     (source "Libs/tower.library")
  336.     (dest libs-dest)
  337.     (confirm)
  338. )
  339.  
  340. (complete 45)
  341.  
  342. (copylib
  343.     (help @copylib-help)
  344.     (prompt "Copying codec.class...")
  345.     (source "Classes/codec.class")
  346.     (dest class-dest)
  347.     (confirm)
  348. )
  349.  
  350. (complete 55)
  351.  
  352. (copylib
  353.     (help @copylib-help)
  354.     (prompt "Copying picture.codec...")
  355.     (source "Classes/Codecs/picture.codec")
  356.     (dest (tackon class-dest "Codecs"))
  357.     (confirm)
  358. )
  359.  
  360. (complete 65)
  361.  
  362. (copylib
  363.     (help @copylib-help)
  364.     (prompt "Copying jpeg.codec...")
  365.     (source "Classes/Codecs/jpeg.codec")
  366.     (dest (tackon class-dest "Codecs"))
  367.     (confirm)
  368. )
  369.  
  370. (complete 90)
  371.  
  372. (copylib
  373.     (help @copylib-help)
  374.     (prompt "Copying jfif.datatype...")
  375.     (source "Classes/DataTypes/jfif.datatype")
  376.     (dest (tackon class-dest "DataTypes"))
  377.     (confirm)
  378. )
  379.  
  380. ;****************************************************************************
  381. ;
  382. ; Exit
  383. ;
  384.  
  385. (if (= reboot 0)
  386.     (
  387.         (run "Avail >NIL: FLUSH")
  388.         (run "AddDataTypes >NIL: Devs/DataTypes/JFIF")
  389.         (complete 100)
  390.         (exit #support-me "The JFIF DataType is now ready to be used.  Enjoy!")
  391.     )
  392.     ; else
  393.     (
  394.         (complete 100)
  395.         ; every beta tester forgot to reboot...
  396.         (user 1)
  397.         (if (askbool (help #why-reboot) (prompt "Installation of JFIF DataType has been completed.\n\n" #support-me "A reboot is required before you can use the JFIF DataType.  Do you want to reboot now?") (choices "Reboot" "Cancel"))
  398.             (run "Reboot")
  399.         )
  400.         (exit "\n*** YOU MUST REBOOT BEFORE USING THE DATATYPE ***")
  401.     )
  402. )
  403.  
  404.